﻿<%@ Page Language="C#" MasterPageFile="~/Pages/MasterPage.master" AutoEventWireup="true" CodeFile="Cart.aspx.cs" Inherits="Pages_Cart" Title="Untitled Page" %>

<%@ Register Assembly="DevExpress.Web.ASPxEditors.v8.2, Version=8.2.4.0, Culture=neutral, PublicKeyToken=49d90c14d24271b5"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style1
        {
            width: 229px;
        }
        .style3
        {
            width: 201px;
        }
        .style4
        {
            width: 100px;
        }
    </style>
    <title>Imagevn upload and printing pro</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="titleClient">
<h1>Shoping Cart</h1></div>

<div class="contentClient">
    <div id="MainContent">
        <div style="text-align:center; padding:20px; margin:0px auto; width:800px; font-weight:100; font-size:14px">
            
            <table width="100%">
                <tr>
                    <td>
                                <asp:GridView ID="gvCart" runat="server" AutoGenerateColumns="false" OnRowCreated="gvCart_RowCreated">
            <Columns>
                <asp:BoundField HeaderText="Image ID" DataField="Image_id"  HeaderStyle-Width="70px"/>
                <asp:TemplateField HeaderText="Image"  HeaderStyle-Width="70px">
                    <ItemTemplate>
                        <img alt="" src='../<%# Eval("Image_URL") %>' width="40" height="40px"/>

                    </ItemTemplate>
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="Size" HeaderStyle-Width="100px">
                    <ItemTemplate>
                        <asp:DropDownList ID="cbxSize" runat="server" AppendDataBoundItems="true" DataSourceID="ObjectDataSource1" 
DataTextField="Size_Name" DataValueField="Size_ID"  SelectedValue='<%# Eval("Size_id") %>'>
                        </asp:DropDownList>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField HeaderText="Price" DataField="Price" HeaderStyle-Width="100px"/>
                <asp:TemplateField HeaderText="Quantity" HeaderStyle-Width="100px">
                    <ItemTemplate>
                        
                        <asp:TextBox ID="txtQuantity" runat="server" Text='<%# Eval("Quantity") %>' Width="70px" ></asp:TextBox>
                        
                        <br />
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="Not empty" ControlToValidate="txtQuantity" Display="Dynamic" ValidationGroup="validQ"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage="Invalid Quantity" ControlToValidate="txtQuantity" Display="Dynamic" ValidationGroup="validQ" ValidationExpression="\d+"></asp:RegularExpressionValidator>
                    </ItemTemplate>
                </asp:TemplateField>  
                <asp:BoundField HeaderText="Total" DataField="Total"  HeaderStyle-Width="100px"/>
                <asp:TemplateField HeaderStyle-Width="100px">
                    <ItemTemplate>
                        <img src="../Admin/Images/delete.png" width="20px" height="20px" /> <asp:LinkButton ID="lnkDelete" runat="server" CommandArgument='<%# Eval("Size_id")+","+Eval("Image_id") %>' OnClick="lnkDelete_Click" OnClientClick="return confirm('Are you sure?');">Delete</asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            </asp:GridView>
                    </td>
                </tr>
                <tr>
                    <td>
                        <h1 style="color:Red; font-size:larger; font-weight:bold"><asp:Label ID="lblError" runat="server" Text="Cart is empty" Visible="false"></asp:Label></h1>
                    </td>
                </tr>
                <tr>
                    <td align="left" style="border-bottom:solid 1px gray;">
                        <asp:Button ID="btnContinue" runat="server" Text="" CssClass="continue" 
                            CausesValidation="false" onclick="btnContinue_Click"/>
                        <asp:Button ID="btnChange" runat="server" Text="" CssClass="updatecart" 
                            onclick="btnChange_Click" ValidationGroup="validQ"/>
                        <asp:Button ID="btnOrder" runat="server" Text=""  CssClass="order" 
                            onclick="btnOrder_Click" CausesValidation="true" ValidationGroup="shipinfo"/>
                    </td>
                </tr>
            </table>
            
            <table width="100%">
                <caption><h2 style="font-size:large; font-weight:bold; color:Gray; text-align:left">Shipping Information</h2></caption>
                <tr>
                    <td style="text-align:left" class="style1">Name:</td>
                    <td style="text-align:left">
                        <asp:TextBox ID="txtName" runat="server" Width="254px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td style="text-align:left" class="style1"></td>
                    <td style="text-align:left">
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" 
                            runat="server" ValidationGroup="shipinfo"  ErrorMessage="*Name is not empty" 
                            Display="Dynamic" ControlToValidate="txtName"></asp:RequiredFieldValidator>
                        </td>
                </tr>
                <tr>
                    <td style="text-align:left" class="style1">Phone:</td>
                    <td style="text-align:left">
                        <asp:TextBox ID="txtPhone" runat="server" Width="254px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td style="text-align:left" class="style1"></td>
                    <td style="text-align:left">
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" 
                            runat="server" ValidationGroup="shipinfo"  ErrorMessage="*Phone is not empty" 
                            Display="Dynamic" ControlToValidate="txtPhone"></asp:RequiredFieldValidator>
                        </td>
                </tr>
                <tr>
                    <td style="text-align:left" class="style1">Address:</td>
                    <td style="text-align:left">
                        <asp:TextBox ID="txtAddress" runat="server" TextMode="MultiLine" Height="102px" 
                            Width="254px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td style="text-align:left" class="style1"></td>
                    <td style="text-align:left">
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" 
                            runat="server" ValidationGroup="shipinfo"  ErrorMessage="*Address is not empty" 
                            Display="Dynamic" ControlToValidate="txtAddress"></asp:RequiredFieldValidator>
                        </td>
                </tr>
                <tr>
                    <td class="style1">
                    
                    </td>
                    <td style="text-align:left">
                        <asp:Button ID="btnReset" runat="server" Text="" CssClass="resetinfo" 
                            onclick="btnReset_Click" />
                            
                    </td>
                </tr>
                
                <tr>
                    <td style="text-align:left" class="style1">Payment Method:</td>
                    <td style="text-align:left">
                       <asp:RadioButton ID="radDirectPay" AutoPostBack="true" runat="server" Text="Direct payment " Checked="true" GroupName="paymentmethod"/> <asp:RadioButton ID="radCreditCart" runat="server"  AutoPostBack="true"  Text="Credit Cart" GroupName="paymentmethod"/>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">

                        
                    <div runat="server" id="tableCredit">
                        <table width="100%">
                        <caption><h2 style="font-size:large; font-weight:bold; color:Gray; text-align:left">Credit Cart</h2></caption>
                            <tr>
                                <td style="text-align:left" class="style4">Card Number:</td>
                                <td style="text-align:left" class="style3"><asp:TextBox ID="txtCardNumber" runat="server" Width="254px"></asp:TextBox></td>
                                
                            </tr>
                            <tr>
                                <td style="text-align:left" class="style4"></td>
                                <td style="text-align:left" class="style3">
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ValidationGroup="credit"  ErrorMessage="* Credit Card is not empty" Display="Dynamic" ControlToValidate="txtCardNumber"></asp:RequiredFieldValidator>
                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                        ControlToValidate="txtCardNumber" Display="Dynamic" 
                                        ErrorMessage="* Credit card  must be a number" ValidationExpression="\d+"></asp:RegularExpressionValidator>
                                </td>
                               
                            </tr>
                            <tr>
                                <td style="text-align:left" class="style4">Owner Card:</td>
                                <td style="text-align:left" class="style3"><asp:TextBox ID="txtOwnerCard" runat="server" Width="254px"></asp:TextBox></td>
                                
                            </tr>
                            <tr>
                                <td style="text-align:left" class="style4"></td>
                                <td style="text-align:left" class="style3">
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                        ValidationGroup="credit"  ErrorMessage="* Owner card is not empty" 
                                        Display="Dynamic" ControlToValidate="txtOwnerCard"></asp:RequiredFieldValidator></td>
                                
                            </tr>
                            <tr>
                                <td style="text-align:left" class="style4">Expiration Date:</td>
                                <td style="text-align:left" class="style3">
                                    <asp:DropDownList ID="cbxMonth" runat="server"> 
                                        
                                    </asp:DropDownList> / <asp:DropDownList ID="cbxYear"  runat="server"> 
                                        
                                    </asp:DropDownList>
                                    </td>
                            </tr>
                            <tr>
                                <td class="style4">
                                </td>
                                <td style="text-align:left" class="style3">
                                    <asp:Button ID="btnCheckCreditCard" runat="server" Text="" 
                                        CssClass="creditcard" onclick="btnCheckCreditCard_Click" ValidationGroup="credit" />
                                </td>
                            </tr>
                        </table>
                        
                     </div>
                    </td>
                </tr>
                
            </table>
            
            
            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                DeleteMethod="Delete" InsertMethod="Insert" 
                OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" 
                TypeName="SizeDataTableAdapters.SizeTableAdapter" UpdateMethod="Update">
                <DeleteParameters>
                    <asp:Parameter Name="Original_Size_ID" Type="Int32" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="Size_Name" Type="String" />
                    <asp:Parameter Name="Price" Type="Double" />
                    <asp:Parameter Name="Original_Size_ID" Type="Int32" />
                </UpdateParameters>
                <InsertParameters>
                    <asp:Parameter Name="Size_Name" Type="String" />
                    <asp:Parameter Name="Price" Type="Double" />
                </InsertParameters>
            </asp:ObjectDataSource>
        </div>
    </div>
</div>
</asp:Content>

